//Es5 地图
// function Map(el){
//     this.el=document.querySelector(el)
//     this.width = '800px'
//     this.height = '400px'
// }
// Map.prototype.create=function(){
//     this.el.style.width=this.width
//     this.delete.style.height=this.height
//     this.el=style.background='./url(./bg.png)'
//     this.el=style.border='10px solid green'
//     this.el.style.position='relative'
// }

//Es6
class Map
{
    constructor(el){
        //保存地图对象
        this.el = el
        //记录地图属性
        this.width = 800
        this.height = 400
    }
    //创建地图
    create(){
        //this 代表map构造函数的实例
        //设置map属性
        this.el.style.width = this.width+'px'
        this.el.style.height = this.height+'px'
        this.el.style.background = 'url(./bg.png)'
        this.el.style.border = '10px solid green'
        this.el.style.position='relative'
    }
}